home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / javax / swing / DesktopManager.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  4.4 KB  |  107 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)DesktopManager.java    1.8 98/08/26
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package javax.swing;
  16.  
  17. /** DesktopManager objects are owned by a JDesktopPane object. They are responsible
  18.   * for implementing L&F specific behaviors for the JDesktopPane. JInternalFrame 
  19.   * implementations should delegate specific behaviors to the DesktopManager. For
  20.   * instance, if a JInternalFrame was asked to iconify, it should try:
  21.   * <PRE>
  22.   *    getDesktopPane().getDesktopManager().iconifyFrame(frame);
  23.   * </PRE>
  24.   * This delegation allows each L&F to provide custom behaviors for desktop-specific
  25.   * actions. (For example, how and where the internal frame's icon would appear.)
  26.   * 
  27.   * @see JDesktopPane
  28.   * @see JInternalFrame
  29.   * @see JInternalFrame.JDesktopIcon
  30.   *
  31.   * @version 1.8 08/26/98
  32.   * @author David Kloba
  33.   */
  34. public interface DesktopManager
  35. {
  36.     /** If possible, display this frame in an appropriate location.
  37.       * Normally, this is not called, as the creator of the JInternalFrame
  38.       * will add the frame to the appropriate parent.
  39.       */
  40.     void openFrame(JInternalFrame f); 
  41.  
  42.     /** Generally, this call should remove the frame from it's parent. */
  43.     void closeFrame(JInternalFrame f); 
  44.  
  45.     /** Generally, the frame should be resized to match it's parents bounds. */
  46.     void maximizeFrame(JInternalFrame f);
  47.     /** Generally, this indicates that the frame should be restored to it's 
  48.       * size and position prior to a maximizeFrame() call.
  49.       */
  50.     void minimizeFrame(JInternalFrame f);
  51.     /** Generally, remove this frame from it's parent and add an iconic representation. */
  52.     void iconifyFrame(JInternalFrame f);
  53.     /** Generally, remove any iconic representation that is present and restore the
  54.       * frame to it's original size and location.
  55.       */
  56.     void deiconifyFrame(JInternalFrame f);
  57.  
  58.     /** 
  59.      * Generally, indicate that this frame has focus. This is usually called after 
  60.      * the JInternalFrame's IS_SELECTED_PROPERTY has been set to true.
  61.      */
  62.     void activateFrame(JInternalFrame f);
  63.  
  64.     /** 
  65.      * Generally, indicate that this frame has lost focus. This is usually called 
  66.      * after the JInternalFrame's IS_SELECTED_PROPERTY has been set to false.
  67.      */
  68.     void deactivateFrame(JInternalFrame f);
  69.  
  70.     /** This method is normally called when the user has indicated that 
  71.       * they will begin dragging a component around. This method should be called
  72.       * prior to any dragFrame() calls to allow the DesktopManager to prepare any
  73.       * necessary state. Normally <b>f</b> will be a JInternalFrame.
  74.       */
  75.     void beginDraggingFrame(JComponent f);
  76.  
  77.     /** The user has moved the frame. Calls to this method will be preceeded by calls
  78.       * to beginDraggingFrame(). 
  79.       *  Normally <b>f</b> will be a JInternalFrame.
  80.       */
  81.     void dragFrame(JComponent f, int newX, int newY);
  82.     /** This method signals the end of the dragging session. Any state maintained by
  83.       * the DesktopManager can be removed here.  Normally <b>f</b> will be a JInternalFrame.
  84.       */
  85.     void endDraggingFrame(JComponent f);
  86.  
  87.     /** This methods is normally called when the user has indicated that 
  88.       * they will begin resizing the frame. This method should be called
  89.       * prior to any resizeFrame() calls to allow the DesktopManager to prepare any
  90.       * necessary state.  Normally <b>f</b> will be a JInternalFrame.
  91.       */
  92.     void beginResizingFrame(JComponent f, int direction);
  93.     /** The user has resized the component. Calls to this method will be preceeded by calls
  94.       * to beginResizingFrame(). 
  95.       *  Normally <b>f</b> will be a JInternalFrame.
  96.       */
  97.     void resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight);
  98.     /** This method signals the end of the resize session. Any state maintained by
  99.       * the DesktopManager can be removed here.  Normally <b>f</b> will be a JInternalFrame.
  100.       */
  101.     void endResizingFrame(JComponent f);
  102.  
  103.     /** This is a primative reshape method.*/
  104.     void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight);
  105. }
  106.  
  107.